#pragma once
#ifndef BOUNDINGBOX_H
#define BOUNDINGBOX_H

#include <vector>

#include "Object.h"
#include "Triangle.h"
#include "Globals.h"

using namespace std;

class BoundingBox: public Object {
public:
	BoundingBox(Vector3 min, Vector3 max);
	~BoundingBox();
	
	Object* tIntersect(const Ray& ray, float& distance);
	Vector3 normal(Vector3 at);

	bool addObject(Object* obj);
	void split(int numTimes);

	bool contains(const Object* obj);

	Vector3 bounds[2];

private:
		vector<Object*> objects;
};
#endif //BOUNDINGBOX_H